package com.lpinfo.spca.member.biz.controller;

import com.lpinfo.spca.member.biz.feign.OrderFeignService;
import com.lpinfo.spca.order.api.dto.LpinfoOrderDto;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/member")
public class MemberController {

    @Autowired
    private OrderFeignService orderFeignService;

    /**
     * 会员服务  调用  订单服务接口
     * @param userId
     * @return
     */
    @GetMapping("/getOrderListByUserId/{userId}")
    public Object getOrderListByUserId(@PathVariable Long userId) {
//        try {
//            ///FIXME 测试超时3秒熔断服务
//            Thread.sleep(4000);
//        } catch (InterruptedException e) {
//            e.printStackTrace();
//        }
        return orderFeignService.getOrderListByUserId(userId);
    }

}
